#ifndef __CRYGAMESPYLOBBYUI_H__
#define __CRYGAMESPYLOBBYUI_H__

#pragma once

#if USE_CRYLOBBY_GAMESPY

#include "Lobby/CryLobbyUI.h"

class CCryGameSpyLobbyUI : public CCryLobbyUI
{
public:
																	CCryGameSpyLobbyUI(CCryLobby* pLobby, CCryLobbyService* pService);

					ECryLobbyError					Initialise();
					ECryLobbyError					Terminate();

	virtual ECryLobbyError					ShowGamerCard(uint32 user, CryUserID userID, CryLobbyTaskID* pTaskID, CryLobbyUICallback cb, void* pCbArg);
	virtual ECryLobbyError					ShowGameInvite(uint32 user, CrySessionHandle h, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryLobbyUICallback cb, void* pCbArg);
	virtual	ECryLobbyError					ShowFriends(uint32 user, CryLobbyTaskID* pTaskID, CryLobbyUICallback cb, void* pCbArg);
	virtual ECryLobbyError					ShowFriendRequest(uint32 user, CryUserID userID, CryLobbyTaskID* pTaskID, CryLobbyUICallback cb, void* pCbArg);
	virtual ECryLobbyError					SetRichPresence(uint32 user, SCryLobbyUserData* pData, uint32 numData, CryLobbyTaskID* pTaskID, CryLobbyUICallback cb, void* pCbArg);

	virtual bool										IsDead() const	{ return false; }
	
protected:
	enum ETask
	{
		eT_ShowGamerCard,
		eT_ShowGameInvite,
		eT_ShowFriends,
		eT_ShowFriendRequest,
		eT_SetRichPresence
	};

	ECryLobbyError									StartTask(ETask etask, bool startRunning, uint32 user, CryLobbyUITaskID* pUITaskID, CryLobbyTaskID* pLTaskID, CrySessionHandle h, void* pCb, void* pCbArg);
	void														StartTaskRunning(CryLobbyUITaskID uiTaskID);
	void														EndTask(CryLobbyUITaskID uiTaskID);
	void														StopTaskRunning(CryLobbyUITaskID uiTaskID);

	void														StartShowGamerCard(CryLobbyUITaskID uiTaskID);
	void														StartShowGameInvite(CryLobbyUITaskID uiTaskID);
	void														StartShowFriends(CryLobbyUITaskID uiTaskID);
	void														StartShowFriendRequest(CryLobbyUITaskID uiTaskID);
	void														StartSetRichPresence(CryLobbyUITaskID uiTaskID);

	STask														m_task[MAX_LOBBYUI_TASKS];
};

#endif // USE_CRYLOBBY_GAMESPY

#endif // __CRYGAMESPYLOBBYUI_H__
